package com.mach.platform.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author Administrator
 * @Description:  swagger2 接口 配置
 * @Package: com.mach.platform.config
 * @time 2018/4/20 0020 11:13
 */
@Configuration
public class Swagger2Config {

	/**
	 * 去除  Basic Error Controller 的显示
	 * RequestHandlerSelectors.basePackage("com.mach.platform.com.mach.platform.controller")
	 * useDefaultResponseMessages(false)  设置不显示 默认的 返回信息 201 403 之类
	 * @return
	 */
	@Bean
	public Docket customizeConfig ( ) {

		return new Docket(DocumentationType.SWAGGER_2).useDefaultResponseMessages(false)
				       .apiInfo(new ApiInfoBuilder().title("东土大唐--接口显示").version("1.0.0").build()).select()
				       .apis(RequestHandlerSelectors.basePackage("com.mach.platform")).build();
	}


}
